#include<stdio.h>

int main()
{
    int n = 0;
    int m = 0;
    char c = 0;
    scanf("%d%c%d", &n, &c, &m);
    int a, b, k;
    a = n;
    b = m;
    while (b > 0)
    {
        k = a % b;
        a = b;
        b = k;
    }
    printf("%d%c%d", n / a, c, m / a);
    return 0;
}